import req from './0_http'

export const testGet = () => req.get('https://v1.hitokoto.cn/')

export type IGetMockList = Record<'id' | 'name' | 'content' | 'ip' | 'phone' | 'time', string> & {
  status: 0 | 1
}

export const getMockList = (params: any): IResList<IGetMockList> => req.get('/getlist', { params })

export const getLMockList = (params: any): IResList => req.get('/getlonglist', { params })

export const getWMockList = (params: any): IResList => req.get('/getweightlist', { params })

export const getMockById = (id: string): Promise<IGetMockList> => req.get('/get/' + id)

export const getMockStat = (): Promise<any> => req.get('/stat')

export const getMenuList = (): Promise<any> => req.get('/menu')

export const getAuthRole = (): Promise<any> => req.get('/auth/role')

export type IGetAuthList = {
  menuInfo: { id: string; name: string; remark: string }
  toolsList: { name: string; has: false | true }[]
}

export const getAuthList = (): IResList<IGetAuthList> => req.get('/auth/list')

export const getUserList = (): IResList => req.get('/user/list')
